<script setup>
import {ref , reactive} from 'vue'
import { get } from '@/util/axios'

const activeName = ref('first')
const params = reactive({
    pageNo: 1,
    pageSize: 10,
})
get('user/getApply',  params , content => {
    console.log(content)
    applyNum.value = content.records.length
})
const applyNum = ref(0)

const handleClick = (tab, event) => {
    if (tab.props.name === 'first') {
        get('user/getApply',  params , content => {
            console.log(content.records.length)
        })
    }
}
</script>

<template>
    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
        <el-tab-pane name="first">
            <template #label>
                <el-badge  :offset="[6,-2]" :value="applyNum">
                    <span>商家申请</span>
                </el-badge>
            </template>
            <div>

            </div>
        </el-tab-pane>
        <el-tab-pane label="剧本数据" name="second">
            juben
        </el-tab-pane>
        <el-tab-pane label="用户反馈" name="fourth">
            Task
        </el-tab-pane>
    </el-tabs>
</template>



<style>
.sup-badge {
    margin-top: -10px;
}

</style>